package com.macro.mall.model_jpa;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

@Data
@Entity
@Table(name = "cms_help")
@DynamicInsert
public class CmsHelp implements Serializable {

    private static final long serialVersionUID = 1L;

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "id")
    private Long id;

    @Column(name = "category_id")
    private Long categoryId;

    @Column(name = "icon")
    private String icon;

    @Column(name = "title")
    private String title;

    @Column(name = "show_status")
    private Integer showStatus;

    @Column(name = "create_time")
    @CreatedDate
    private Date createTime;

    @Column(name = "read_count")
    private Integer readCount;

    @Column(name = "content")
    private String content;

    @ManyToOne(targetEntity = CmsHelpCategory.class)
    @JoinColumn(name = "category_id", referencedColumnName = "id")
    private CmsHelpCategory helpCategory;
}